/*
*  Copyright (c) 2010-2023
*/
package net.siufung.market.base.uuid.controller.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import javax.validation.constraints.NotNull;
import net.siufung.core.utils.StringPool;
import org.hibernate.validator.constraints.Length;
import net.siufung.core.utils.CopyUtil;
import net.siufung.market.base.uuid.mapper.entity.SysUuidRules;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.siufung.core.model.AbstractVo;
import net.siufung.core.model.AbstractDto;
import net.siufung.core.page.PagerDto;
/**
* 流水号配置表 模型
*
* @author 陈建峰
* @since 2023-10-09 22:16:17
*/
public class SysUuidRulesModel {

    @Data
    @ApiModel(value="SysUuidRulesDto", description="流水号配置表默认传参对象")
    public static class Dto implements Serializable {

        private static final long serialVersionUID = 1711385139373821952L;
        /**
         * 主键id
         */
        @ApiModelProperty(value = "主键id")
        private Integer id;
        /**
         * 流水号id
         */
        @ApiModelProperty(value = "流水号id")
        private Integer uuidId;
        /**
         * 规则类型
         */
        @ApiModelProperty(value = "规则类型")
        private String uuidPartType;
        /**
         * 规则配置值
         */
        @ApiModelProperty(value = "规则配置值")
        private String uuidPartValue;
        /**
         * 排序
         */
        @ApiModelProperty(value = "排序")
        private Integer sequence;
        /**
         * 描述
         */
        @ApiModelProperty(value = "描述")
        private String description;

        /**
         * 转化成数据库实体
         * @return SysUuidRules
         */
        public SysUuidRules to(){
            SysUuidRules sysUuidRules = new SysUuidRules();
            CopyUtil.copyProperties(this, sysUuidRules);
            return sysUuidRules;
        }
    }

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel(value="SysUuidRulesPageDto", description="流水号配置表分页传参对象")
    public static class PageDto extends PagerDto {

        /**
         * 流水号id
         */
        @ApiModelProperty(value = "流水号id")
        private Integer uuidId;
        /**
         * 规则类型
         */
        @ApiModelProperty(value = "规则类型")
        private String uuidPartType;
    }

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel(value="SysUuidRulesSaveDto", description="流水号配置表创建传参对象")
    public static class SaveDto extends AbstractDto {

        private static final long serialVersionUID = 1L;

        /**
         * 流水号id
         */
        @ApiModelProperty(value = "流水号id", required = true)
        @NotNull(message = "流水号id不能为空!")
        private Integer uuidId;

        /**
         * 规则类型
         */
        @ApiModelProperty(value = "规则类型")
        @Length(max=1, message="规则类型长度不大于1!")
        private String uuidPartType;

        /**
         * 规则配置值
         */
        @ApiModelProperty(value = "规则配置值")
        @Length(max=255, message="规则配置值长度不大于255!")
        private String uuidPartValue;

        /**
         * 排序
         */
        @ApiModelProperty(value = "排序", required = true)
        @NotNull(message = "排序不能为空!")
        private Integer sequence;

        /**
         * 描述
         */
        @ApiModelProperty(value = "描述")
        @Length(max=255, message="描述长度不大于255!")
        private String description;

        public SysUuidRules to(){
            SysUuidRules sysUuidRules = new SysUuidRules();
            CopyUtil.copyProperties(this, sysUuidRules);
            return sysUuidRules;
        }
    }


    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel(value="SysUuidRulesUpdateDto", description="流水号配置表更新传参对象")
    public static class UpdateDto extends AbstractDto {

        private static final long serialVersionUID = 1L;

        /**
         * 主键id
         */
        @ApiModelProperty(value = "主键id", required = true)
        @NotNull(message = "主键id不能为空!")
        private Integer id;

        /**
         * 流水号id
         */
        @ApiModelProperty(value = "流水号id", required = true)
        @NotNull(message = "流水号id不能为空!")
        private Integer uuidId;

        /**
         * 规则类型
         */
        @ApiModelProperty(value = "规则类型")
        @Length(max=1, message="规则类型长度不大于1!")
        private String uuidPartType;

        /**
         * 规则配置值
         */
        @ApiModelProperty(value = "规则配置值")
        @Length(max=255, message="规则配置值长度不大于255!")
        private String uuidPartValue;

        /**
         * 排序
         */
        @ApiModelProperty(value = "排序", required = true)
        @NotNull(message = "排序不能为空!")
        private Integer sequence;

        /**
         * 描述
         */
        @ApiModelProperty(value = "描述")
        @Length(max=255, message="描述长度不大于255!")
        private String description;

        public SysUuidRules to(){
            SysUuidRules sysUuidRules = new SysUuidRules();
            CopyUtil.copyProperties(this, sysUuidRules);
            return sysUuidRules;
        }
    }

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel(value="SysUuidRulesVo", description="流水号配置表")
    public static class Vo extends AbstractVo {

        private static final long serialVersionUID = 1L;
        /**
         * 主键id
         */
        @ApiModelProperty(value = "主键id")
        private Integer id;
        /**
         * 流水号id
         */
        @ApiModelProperty(value = "流水号id")
        private Integer uuidId;
        /**
         * 规则类型
         */
        @ApiModelProperty(value = "规则类型")
        private String uuidPartType;
        /**
         * 规则配置值
         */
        @ApiModelProperty(value = "规则配置值")
        private String uuidPartValue;
        /**
         * 排序
         */
        @ApiModelProperty(value = "排序")
        private Integer sequence;
        /**
         * 描述
         */
        @ApiModelProperty(value = "描述")
        private String description;
        /**
         * 创建人
         */
        @ApiModelProperty(value = "创建人")
        private String createdBy;
        /**
         * 创建时间
         */
        @ApiModelProperty(value = "创建时间")
        @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private LocalDateTime createdAt;


        public String getUuidPartTypeDesc() {
            // 扩展开发
            return StringPool.EMPTY;
        }







    }

}